I want to write a script (to be run from Administrator account) that will go through a project and return the access permissions to every module in the database. EG:
for accessRight in module do {
print accessRight.username "="
print accessRight.access "\n"
}
Peter.Dawson - Mon Dec 14 00:18:14 EST 2009 |
Re: Get Access Permissions to Module I've needed a similar overview a few month ago and wrote this script. I hope its useful to you. And yes, you dont need to open the modules to get informations about permissions, you do this with the AccessRec get() function, you can find the documentation in the DXL Reference Manual. Regards, Manuel Attachments attachment_14417027_Project_Overview_projects.dxl |
Re: Get Access Permissions to Module ManuelFelger - Mon Dec 14 08:30:57 EST 2009 |
Re: Get Access Permissions to Module ManuelFelger - Mon Dec 14 08:30:57 EST 2009 One more thing. Can the AccessRec function also be used to return the access rights for modifying an Attribute Definition as well as access rights to Attribute Values. It looks like I will need to report this information as well. Cheers Peter |
Re: Get Access Permissions to Module llandale - Mon Dec 14 17:25:33 EST 2009 You don't have to open the Module since DOORS v8.0, as you can access the Attribute definition through the "ModuleProperties" object. But I must confess I never was lucky using it (segmentation faults each time I tried to loop through folders). |
Re: Get Access Permissions to Module Peter.Dawson - Mon Dec 14 18:46:31 EST 2009 Hi, You may find this usefull too:
Permission permission (AccessRec ar) {
Permission returned = none
if read(ar) then returned = returned | read
if modify(ar) then returned = returned | modify
if create(ar) then returned = returned | create
if delete(ar) then returned = returned | delete
if control(ar) then returned = returned | control
return returned
}
string stringOf (Permission p){
string returned = ""
if (p & read == read ) returned = returned "R"
if (p & modify == modify ) returned = returned "M"
if (p & create == create ) returned = returned "C"
if (p & delete == delete ) returned = returned "D"
if (p & control == control) returned = returned "A"
if (returned == "" ) returned = "none"
return returned
}
|
Re: Get Access Permissions to Module ManuelFelger - Mon Dec 14 08:30:57 EST 2009
Thanks all, Manuel's original post answers my question.
for g in groupList do
{
string groupName = g.name
string errMsg
AccessRec ar = get(p, groupName, errMsg)
if (null ar) {}
elseif (control ar)
//.....etc
}
|
Re: Get Access Permissions to Module ManuelFelger - Mon Dec 14 08:30:57 EST 2009 |
Re: Get Access Permissions to Module SR-ITC - Thu Sep 15 08:38:28 EDT 2011 Does this answer the question?
AccessRec ar
string NameAccess
for ar in mod do
{ NameAccess = username(ar) // My code surrounds this with noError/lastError, but don't recall why.
if (isDefault(ar))
{} // Everyone else
if NameAccess == getAdministratorName())
{} // v7x bug where the Admin got access records (at least for Views)
elseif(existsGroup(NameGroup)
{ Group grp = find(NameAccess) // Deal with Group access
}
elseif(existsUser(NameAccess)
{ User usr = find(NameAccess)
}
else
{} // out of possibilities, I think.
}
|
Re: Get Access Permissions to Module llandale - Thu Sep 15 15:01:17 EDT 2011 Does this answer the question?
AccessRec ar
string NameAccess
for ar in mod do
{ NameAccess = username(ar) // My code surrounds this with noError/lastError, but don't recall why.
if (isDefault(ar))
{} // Everyone else
if NameAccess == getAdministratorName())
{} // v7x bug where the Admin got access records (at least for Views)
elseif(existsGroup(NameGroup)
{ Group grp = find(NameAccess) // Deal with Group access
}
elseif(existsUser(NameAccess)
{ User usr = find(NameAccess)
}
else
{} // out of possibilities, I think.
}
|